Skip to content

Conversation

@ngholiza
Copy link
Collaborator

Brings the isolated RCAC computational pilot (Quantum ESPRESSO on Negishi and Gautschi through Globus Compute and Slurm) into dev, and makes physical vs computational explicit in the database and the UI. Rushik and Justin tested the pilot and found it smooth.

The computation feature stays off until RCAC_COMPUTE_ENABLED=true is set; the computation tables are created empty either way.

What changes

  • Pilot code: registered CellRelaxDFT, CellRelaxDFT 2D and ElasticDFT workflows, the Globus gateway and worker, per-run resources (submit_v2), ElasticDFT failure diagnostics, typed run values, and the computational help pages.
  • Database roles: the computation API and worker use api_worker (not the table owner) and keep their own project-access checks. add_row_level_security.sql grants api_worker policies on the three computation tables.
  • Physical vs computational: equipment_metadata.asset_kind, experiment_types.execution_kind (set by a trigger from the template's equipment, so forks keep their kind), and an all_runs view with run_kind under each table's RLS. Applied once by checksum in db_migrations.
  • UI: the equipment list shows Physical equipment and Computational tools separately, and the template library labels each template's kind.
  • The generic run endpoint refuses computational equipment and templates (409). User-created template ids no longer take the reserved computation_ prefix.

Merge decisions

  • dev's router check "at least one planned value" stays removed: an all-variable optimization run takes no point values, and the definition decides which inputs are required. test_project_run_requires_planned_parameter_values was removed; the pilot's run-value tests cover these rules.
  • The proposal job runner resolves objectives and the optimization domain from the claimed run, as the pilot's initial generation did. The RLS job-queue tests stub that resolver because they test queue mechanics.
  • Three pilot tests hidden by test_*.py in .gitignore were force-added.

Review and tests

  • Codex reviewed the branch: 3 P2 findings, then 2 follow-ups and 1 edge case, all fixed. Final verdict: APPROVE.
  • 489 unit tests and 79 Postgres tests (RLS, uploads, notifications, computation E2E, run values) pass on a fresh Postgres 15 with migrations applied from scratch. Web type check and lint are clean.

Rollout

Run the dt-db-migrate Job with this image before rolling out dt-api. A computation worker needs PG_WORKER_USER/PG_WORKER_PASS (see geddes/k8s/09-rcac-worker.example.yaml).

🤖 Generated with Claude Code

Brings the isolated pilot's uncommitted work onto a branch: per-run
resource requests (submit_v2 gateway protocol), ElasticDFT failure
diagnostics and backfill, the run-values fixes, the computational FAQ
and help pages, and the pilot provisioning and validation scripts.

Review transcripts, deployment dumps and evidence folders stay local.

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01QS1dbWTNbwqxXZUMEARjhm
Resolves the pilot against dev's database roles, migration runner,
proposal job queue and template editing:

- Computation store uses the api_worker role (not the superuser) and
  keeps its project-access checks; migrations create the computation
  tables unconditionally and add api_worker policies for them.
- The proposal job runner resolves objectives and domain from the
  claimed run, as the pilot's initial generation did.
- The run form keeps the pilot's typed run values and computational
  redirects, plus dev's edit-in-place and idempotency key.
- dev's "at least one planned value" check stays removed: an
  all-variable optimization run takes no point values, and the
  definition decides which inputs are required.
- Restores three pilot tests that test_*.py in .gitignore had hidden.

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01QS1dbWTNbwqxXZUMEARjhm
Computational tools shared the catalog tables with lab instruments and
were recognized only by conventions. Make the split explicit:

- equipment_metadata.asset_kind (physical | computational), backfilled
  for the registered RCAC installations.
- experiment_types.execution_kind, set by a trigger from the
  template's equipment, so forks of a computational template stay
  computational whichever path creates them.
- all_runs view: every run with run_kind, under each table's RLS.
- The generic run endpoint refuses computational equipment; the
  classifier prefers execution_kind over the id prefix.
- Equipment list shows Physical equipment and Computational tools
  separately; the template library badges each template's kind.
- The example RCAC worker manifest uses the api_worker role.

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01QS1dbWTNbwqxXZUMEARjhm
- Cache hits reuse the run that executed, never another reuse, so
  artifact lineage stays one hop after repeated identical submissions.
- An explicitly physical template is never treated as computational,
  user-created template ids never take the reserved computation_
  prefix, and the run endpoint rejects by equipment kind instead of
  guessing from the id.
- JSON object and array choices are compared as parsed JSON, not as
  Python's str() of a dict or list.

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01QS1dbWTNbwqxXZUMEARjhm
- The browser honours an explicitly physical template: the shared
  classifier returns non-computational for execution_kind "physical",
  and the run wizard only pre-blocks a catalog id naming a known tool
  until the template itself has loaded.
- JSON choices compare by value, so 50 matches 50.0 while true still
  does not match 1.

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01QS1dbWTNbwqxXZUMEARjhm
Converting to float made distinct large integers (above 2**53) equal
and could overflow; Python's own int/float comparison is exact.

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01QS1dbWTNbwqxXZUMEARjhm
Sign in to join this conversation on GitHub.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant